$(function () {
	var pagenum = 2;
    $(window).scroll(function () {
        var totalHeight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
        if ($(document).height() <= totalHeight) {
            if (stop == true) {
            	stop = false;
                $.ajax({ 
   				 url: '/load/getpageCollet', 
   				 type: "GET",
   		         data: {page: pagenum},
   		         dataType: "json",//请求数据类型
   				 success: function(data){
   					 if(data.code == 0){
   						pagenum ++; 
   						 var result = data.data;
   						 $("#datalist").append(result);
   						 if(data.hasnext){
   							stop = true;
   						 }else{
   							stop = false;
   						 }
   					 }else{
   						sstb.dialog(data.msg);
   						stop = true;
   					 }
   				 },
   				 error : function() {
   					sstb.dialog("获取失败");
   					stop = true;
   				 }
   			 })
            }else{
            	$('.Headline-Load').hide();
            	sstb.dialog("没有更多收藏内容啦");
            }
        }
    });
	
})